package com.lanchuan.soft.controller;

import com.lanchuan.soft.entity.ParamUser;
import com.lanchuan.soft.service.IStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("statistics")
public class StatisticsController {

    private IStatisticsService statisticsService;

    @Autowired
    public StatisticsController(IStatisticsService statisticsService) {
        this.statisticsService = statisticsService;
    }

    // 根据问题分类获取统计信息
    @RequestMapping("findStatisticsGroupByEventType")
    public Map<String, Object> findStatisticsGroupByEventType(@RequestBody ParamUser paramUser) {
        return statisticsService.findStatisticsGroupByEventType(paramUser);
    }

    // 根据日期获取统计信息
    @RequestMapping("findStatisticsGroupByDate")
    public Map<String, Object> findStatisticsGroupByDate(@RequestBody ParamUser paramUser) {
        return statisticsService.findStatisticsGroupByDate(paramUser);
    }

    // 总计统计信息
    @RequestMapping("findStatisticsGroupByTotal")
    public Map<String, Object> findStatisticsGroupByTotal(@RequestBody ParamUser paramUser) {
        return statisticsService.findStatisticsGroupByTotal(paramUser);
    }

    // 总计统计信息
    @RequestMapping("findImageListLimit")
    public Map<String, Object> findImageListLimit(@RequestBody ParamUser paramUser) {
        return statisticsService.findImageListLimit(paramUser);
    }
}
